
/**
 *  \file obex_fsm_defines.h
 *
 *  This file defines state and events related to OBEX FSM.
 */

/*
 *  Copyright (C) 2012. MindTree Ltd.
 *  All rights reserved.
 */

#ifndef _H_OBEX_FSM_DEFINES_
#define _H_OBEX_FSM_DEFINES_

/* --------------------------------------------- Header File Inclusion */
#include "BT_obex_api.h"
#include "fsm_engine.h"
#include "obex_fsm.h"

/* --------------------------------------------- Global Definitions */
/* Number of OBEX events at the FSM */
#define OBEX_MAX_NUM_EVENTS     0x0F

/* OBEX Local and Remote event identifier */
#define OBEX_FSM_LOCAL_EVENT    0x00
#define OBEX_FSM_REMOTE_EVENT   0x01

/* --------------------------------------------- External Global Variables */
/* OBEX FSM tables */
extern DECL_CONST EVENT_HANDLER_TABLE obex_event_handler_table[];
extern DECL_CONST STATE_EVENT_TABLE obex_state_event_table[];

/* --------------------------------------------- Structures/Data Types */
typedef struct _OBEX_EVENT_INFO
{
    /*
     * Event Data to the handler: It will be processed in the handler function
     * and based on the event type the processed data might be passed to application or
     * lower layer
     */
    void    * data;

    /* Event Data Length */
    UINT16  datalen;

    /*
     * This handle will used to refer the obex_session structure
     * for updating the tx/rx buffers, obex_state, SRM mode etc.
     */
    UCHAR   obex_handle;

    /* Event */
    EVENT_T     event_type;

    /* Additional information on event */
    UCHAR   event_info;

}OBEX_EVENT_INFO;


/* --------------------------------------------- Functions */
API_RESULT obex_fsm_post_event (OBEX_EVENT_INFO * obex_event);
API_RESULT obex_access_state_handler (void * param, STATE_T * state);

#endif /* _H_OBEX_FSM_DEFINES_ */

